﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<OAonline.Models.WorkFlowModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <p>
            <%=Html.ActionLink("新建工作", "WFNew") %>
        </p>
    </div>
    <div id="WFStart">
        <p>
            发起工作</p>
        <div>
            <table>
                <tr>
                    <th>
                        编码
                    </th>
                    <th>
                        名称
                    </th>
                    <th>
                        创建时间
                    </th>
                    <th>
                        创建人
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <%
                    for (int i = 0; i < Model.dt_wf.Rows.Count; i++)
                    {
                %>
                <tr>
                    <td>
                        <%=Model.dt_wf.Rows[i]["编码"]%>
                    </td>
                    <td>
                        <%=Model.dt_wf.Rows[i]["名称"]%>
                    </td>
                    <td>
                        <%=Model.dt_wf.Rows[i]["创建时间"]%>
                    </td>
                    <td>
                        <%=Model.dt_wf.Rows[i]["创建人"]%>
                    </td>
                    <td>
                        <%=Html.ActionLink("发起", "WFStart", new { wf_id = Model.dt_wf.Rows[i]["编码"], user_id = Model.user_id })%>
                    </td>
                </tr>
                <%
                    } %>
            </table>
        </div>
        <hr size="5">
        <div id="WFWorking">
            <p>
                待办工作</p>
            <div>
                <table>
                    <tr>
                        <th>
                            任务编码
                        </th>
                        <th>
                            实例标识
                        </th>
                        <th>
                            任务名称
                        </th>
                        <th>
                            任务状态
                        </th>
                        <th>
                            开始时间
                        </th>
                        <th>
                            发起人
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                    <%
                        for (int i = 0; i < Model.dt_wfworking.Rows.Count; i++)
                        {
                    %>
                    <tr>
                        <td>
                            <%=Model.dt_wfworking.Rows[i]["任务编码"]%>
                        </td>
                        <td>
                            <%=Model.dt_wfworking.Rows[i]["实例标识"]%>
                        </td>
                        <td>
                            <%=Model.dt_wfworking.Rows[i]["任务名称"]%>
                        </td>
                        <td>
                            <%=Model.dt_wfworking.Rows[i]["任务状态"]%>
                        </td>
                        <td>
                            <%=Model.dt_wfworking.Rows[i]["开始时间"]%>
                        </td>
                        <td>
                            <%=Model.dt_wfworking.Rows[i]["发起人"]%>
                        </td>
                        <td>
                            <%=Html.ActionLink("审批", "WFProcess", 
                                new { uniqueid = Model.dt_wfworking.Rows[i]["实例标识"], 
                                          task_id = Model.dt_wfworking.Rows[i]["任务编码"], 
                                          ptask_id = Model.dt_wfworking.Rows[i]["父级编码"] })%>
                        </td>
                    </tr>
                    <%
                        } %>
                </table>
            </div>
            <hr size="5">
            <div id="WFok">
                <p>
                    已办工作</p>
                <div>
                    <table>
                        <tr>
                            <th>
                                任务编码
                            </th>
                            <th>
                                任务名称
                            </th>
                            <th>
                                任务状态
                            </th>
                            <th>
                                开始时间
                            </th>
                            <th>
                                完成时间
                            </th>
                            <th>
                                发起人
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                        <%
                            for (int i = 0; i < Model.dt_wfworked.Rows.Count; i++)
                            {
                        %>
                        <tr>
                            <td>
                                <%=Model.dt_wfworked.Rows[i]["任务编码"]%>
                            </td>
                            <td>
                                <%=Model.dt_wfworked.Rows[i]["任务名称"]%>
                            </td>
                            <td>
                                <%=Model.dt_wfworked.Rows[i]["任务状态"]%>
                            </td>
                            <td>
                                <%=Model.dt_wfworked.Rows[i]["开始时间"]%>
                            </td>
                            <td>
                                <%=Model.dt_wfworked.Rows[i]["完成时间"]%>
                            </td>
                            <td>
                                <%=Model.dt_wfworked.Rows[i]["发起人"]%>
                            </td>
                            <td>
                                <%=Html.ActionLink("查看明细", "WFTaskDetails", new { uniqueId = Model.dt_wfworked.Rows[i]["实例标识"] })%>
                            </td>
                        </tr>
                        <%
                            } %>
                    </table>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
